from socket import *

CODE = '''
from networkx import *
graph = barabasi_albert_graph(100, 10)
write_edgelist(graph, r'graph.dat')
'''
HOST = '10.0.0.1'
PORT = 9000
MAX_RESPONSE_LENGTH = 10000

client = socket(AF_INET, SOCK_STREAM)
client.connect((HOST, PORT))
client.send(CODE)
sdata = client.recv(MAX_RESPONSE_LENGTH)
f = open(r'graphcopy.dat', 'wb')
f.write(sdata)
f.close()
